<?php slot('skill','active'); ?>
<div class="row-fluid">	
				<div class="box span12">
					<div class="box-header">
						<h2><i class="icon-user"></i>模块导航</h2>
					</div>
					<div class="box-content">
                                          <ul class="nav tab-menu nav-tabs" id="myTab">
							<li class="active"><a href="#info">功能</a></li>
							<li><a href="#custom">统计信息</a></li>
						</ul>
                                          <div id="myTabContent" class="tab-content">
                                              <div class="tab-pane active" id="info">
						<a class="quick-button-small span1" href="<?php echo url_for('skillad/index'); ?>">
							<i class="icon-edit"></i>
							<p>广告管理</p>
						</a>
						<div class="clearfix"></div>
                                                </div>
                                            <div class="tab-pane" id="custom">
                                              <div class="row-fluid">
                                                    <div class="span3 smallstat box mobileHalf noMargin" ontablet="span6" ondesktop="span3">
                                                            <i class="icon-user green"></i>
                                                            <span class="title">会员总数</span>
                                                            <span class="value"></span>
                                                    </div>
                                            </div>
                                            </div>
                                          </div>
					</div>	
				</div><!--/span-->
                                
			</div>
<div class="row-fluid">	
				<div class="box span12">
					<div class="box-header">
						<h2><i class="icon-user"></i>分类管理</h2>
					</div>
					<div class="box-content">
                                          <ul class="nav tab-menu nav-tabs" id="myTab">
							<li class="active"><a href="#info">分类</a></li>
							<!--<li><a href="#custom">统计信息</a></li>-->
						</ul>
                                          <div id="myTabContent" class="tab-content">
                                              
                                              <div class="tab-pane active" id="info">
                                                  
						<a class="quick-button-small span1" href="<?php echo url_for('skill/index'); ?>">
							<i class="icon-edit"></i>
							<p>首页</p>
						</a>
                                                  
                                                  <?php foreach(NewSkill::$category_label as $key=>$data): ?>
                                                  <?php if($key == 0) continue; ?>
                                                  <a class="quick-button-small span1" href="<?php echo url_for('skill/index?category='.$key); ?>">
							<i class="icon-edit"></i>
							<p><?php echo $data; ?></p>
						</a>
                                                  <?php endforeach; ?>
                                                  
						<div class="clearfix"></div>
                                                </div>
                                          </div>
					</div>	
				</div><!--/span-->
                                
			</div>

<div class="row-fluid">	
      <div class="box span12">
              <div class="box-header">
                      <h2>
                        <i class="icon-align-justify"></i><span class="break"></span>
                        技能列表
                      </h2>
              </div>
              <div class="box-content">
                <?php if($sf_user->hasFlash('error')): ?>
                <div class="alert alert-error">
                        <button type="button" class="close" data-dismiss="alert">×</button>
                        <strong>错误！</strong>  <?php echo $sf_user->getFlash('error'); ?>
                </div>
                <?php endif; ?>
                <?php if($sf_user->hasFlash('success')): ?>
                <div class="alert alert-success">
                        <button type="button" class="close" data-dismiss="alert">×</button>
                        <strong>操作成功！</strong> <?php echo $sf_user->getFlash('success'); ?>
                </div>
                <?php endif; ?>
                <?php if($sf_user->hasFlash('notice')): ?>
                <div class="alert alert-info">
                        <button type="button" class="close" data-dismiss="alert">×</button>
                        <strong><?php echo $sf_user->getFlash('notice'); ?></strong> 
                </div>
                <?php endif; ?>
                <div class="row-fluid">
                  
                </div>
                <form id="delete_all_form" action="<?php echo url_for('skill/delete_ids'); ?>" method="post" >
                      <table id="data-list" class="table table-bordered table-striped table-condensed">
                                <thead>
                                        <tr>
                                                <th class="center" style="width:30px;">ID</th>
                                                <th class="center" >标题</th>
                                                <th class="center">分类</th>
                                                 <th class="center">年龄边界</th>
                                                 <th class="center">标签</th>
                                                <th class="center">作者</th>
                                                <th class="center">封面</th>
                                                <th class="center" >审核状态</th>
                                                <th class="center">喜欢</th>
                                                <th class="center">评论</th>
                                                <th class="center">收藏</th>
                                                <th class="center">操作</th>                                            
                                        </tr>
                                </thead>
                                <tbody>
                                 <?php foreach($pager->getResults() as $skill): ?>
                                    <tr>
                                        <td><?php echo $skill->getId(); ?></td>
                                        <td><?php echo $skill->getTitle(); ?></td>
                                        <td><?php echo NewSkill::$category_label[$skill->getCategory()]; ?></td>
                                         <td><?php echo $skill->getMinAge().'-'.$skill->getMaxAge(); ?></td>
                                         <td><?php echo $skill->getTagsToString(); ?></td>
                                         <td><?php echo $skill->getUser()->getNickname(); ?></td>
                                         <td><img src="<?php echo $skill->getCover(); ?>" width="100" height="50" /></td>
                                        <td><?php echo $skill->getStatusToString(); ?></td>
                                        <td><?php echo $skill->getStatistical()->getLikeNum(); ?></td>
                                        <td><?php echo $skill->getStatistical()->getCommentNum(); ?></td>
                                        <td><?php echo $skill->getStatistical()->getFavoritesNum(); ?></td>
                                        <td>
                                            <a href="<?php echo url_for('skill/show?id='.$skill->getId()); ?>">
                                                查看详情
                                            </a>
                                           <a href="<?php echo url_for('skill_comment/index?skill_id='.$skill->getId()); ?>">管理评论</a>
                                        </td>
                                    </tr>
                                 <?php endforeach; ?>
                                </tbody>
                       </table>  
                  </form>
                <?php echo pager_navigation($pager, 'skill/index?category='.$sf_request->getParameter('category',0)); ?>
              </div>
      </div><!--/span-->
</div>
<script type="text/javascript">
function layerOper(url){
	//宽高
	var width = 500,
		height = 180;
	
	layer.open({
                scrollbar: false,
		type: 1,
		title: false, //标题，若不要直接false
		area: [width+'px', height+'px'], //宽高
		content: '<iframe width="100%" height="'+height+'" frameborder="0" src="'+url+'"></iframe>'
                
	});
        
        return false;
}

 $(document).ready(function(){
//   $( "#dialog" ).dialog();
  
  $("#check_all").toggle(function(){
    $("#data-list > TBODY ").find("input[type=checkbox]").attr('checked','checked').parent('SPAN').addClass('checked');
  },function(){
    $("#data-list > TBODY ").find("input[type=checkbox]").removeAttr('checked').parent('SPAN').removeClass('checked');
  });
  
  $("#delete_all").click(function(){
    var select_num = 0;
    $("#data-list > TBODY ").find("input[type=checkbox]").each(function(){
      if($(this).attr('checked') === 'checked'){
        select_num+=1;
      }
    });
    
    if(select_num == 0){
      alert("请先选择需要删除的数据！");
      return false;
    }
    
    $("#delete_all_form").submit();
    
  });
  
  $("#data-list > TBODY > TR").find("TD:eq(10) > A:eq(0)").click(function(){

     var more_info = eval('('+$(this).attr('more_info')+')');
     
     var score = more_info.score,
         fans_num = more_info.fans,
         idols_num = more_info.idols_num,
         account = more_info.account;  
         
     $("#dialog > SPAN:eq(0)").html(score);
     $("#dialog > SPAN:eq(1)").html(fans_num);
     $("#dialog > SPAN:eq(2)").html(idols_num);
     
     $( "#dialog" ).dialog({
       title: account,
       modal:true
     });
  });

 });
</script>